﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLiNhaSachDTO;
using QuanLiNhaSachBUS;
namespace QuanLiNhaSachGUI
{
    public partial class QuanLiTaiKhoan : Form
    {
        public QuanLiTaiKhoan()
        {
            InitializeComponent();
        }
        NhanVien nv;
        public QuanLiTaiKhoan(NhanVien nv)
        {
            InitializeComponent();
            textBox1.Text = nv.Username;
            textBox2.Text = nv.Password;
            comboBox1.Text = nv.Loai;
            this.Text = nv.id + "  " + nv.Ten;
            this.nv = nv;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            nv.Username = textBox1.Text;
            nv.Password = textBox2.Text;
            nv.Loai = comboBox1.Text;
            NhanVienBUS.update(nv);
            this.Close();
        }
    }
}
